using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaHuan.Common;
using BaHuan.Entities;
using BaHuan.DataLayer;
/*
 * There are many processes that handle the flows of data
 * we call them business logic of a program.
 * For each of business logic process we create a class 
 * that handle for that process
 * 
 * */
namespace BaHuan.BusinessLayer
{
	
	public class ButToanMgt
	{
	
		public ResultObj SaveNewButToan(ButToan buttoan)
        		{
			ResultObj result = new ResultObj();
			buttoan.Id = -1;
			ButToanDAO buttoanDAO = new ButToanDAO();
			result = buttoanDAO.SaveButToan(buttoan);
			
			return result;
		}
		
		public ResultObj UpdateButToan(ButToan buttoan)
        		{
			ResultObj result = new ResultObj();
			ButToanDAO buttoanDAO = new ButToanDAO();
			result = buttoanDAO.SaveButToan(buttoan);
			
			return result;
		}
		
		public ResultObj DeleteButToan(ButToan buttoan)
        		{
			ResultObj result = new ResultObj();
			ButToanDAO buttoanDAO = new ButToanDAO();
			result = buttoanDAO.DeleteButToan(buttoan);
			
			return result;
		}
		
		public ResultObj GetAllButToan( )
        		{
			ResultObj result = new ResultObj();
			ButToanDAO buttoanDAO = new ButToanDAO();
			result = buttoanDAO.GetAllButToan();
			
			return result;
		}
		
		public ResultObj GetButToanById(ButToan buttoan)
        		{
			ResultObj result = new ResultObj();
			ButToanDAO buttoanDAO = new ButToanDAO();
			result = buttoanDAO.GetAllButToanByID(buttoan);
			
			return result;
		}

        public ResultObj GetButToanForCongNoTongHop111(DateTime dtTuNgay, DateTime dtDenNgay)
        {
            ResultObj result = new ResultObj();
            ButToanDAO buttoanDAO = new ButToanDAO();
            result = buttoanDAO.GetButToanForCongNoTongHop111(dtTuNgay, dtDenNgay);

            return result;
        }

        public ResultObj GetButToanForCongNoTongHop112(DateTime dtTuNgay, DateTime dtDenNgay)
        {
            ResultObj result = new ResultObj();
            ButToanDAO buttoanDAO = new ButToanDAO();
            result = buttoanDAO.GetButToanForCongNoTongHop112(dtTuNgay, dtDenNgay);

            return result;
        }

        public ResultObj GetAllButToanForCongNoPhaiTra()
        {
            ResultObj result = new ResultObj();
            ButToanDAO buttoanDAO = new ButToanDAO();
            result = buttoanDAO.GetAllButToanForCongNoPhaiTra();

            return result;
        }

        public ResultObj GetAllButToanForCongNoPhaiThu()
        {
            ResultObj result = new ResultObj();
            ButToanDAO buttoanDAO = new ButToanDAO();
            result = buttoanDAO.GetAllButToanForCongNoPhaiThu();

            return result;
        }

        public ResultObj GetAllButtoanForBCDTK(DateTime dt, string MaSoTK)
        {
            ResultObj result = new ResultObj();
            ButToanDAO buttoanDAO = new ButToanDAO();
            result = buttoanDAO.GetAllButtoanForBCDTK(dt, MaSoTK);

            return result;
        }
	}
}
